#pragma once
#include "GameTypedefs.h"

/**
==================================
Updates, and keep tracks of all the
entities in the game world
==================================
*/
class BaseEntity;
class EntityManager
{
public:
    EntityManager(void);

    /** Update each entity */
    void Update( float dt );

    /** Add an Entity to the world */
    void Add( BaseEntity* ent );
    
    /** Remove Entity from the world */
    void Remove( BaseEntity* ent );
    void Remove( type_id id );
    void Remove( const std::string &name );

    /** Clear all Entities */
    void Clear();

    /** Get an Entity */
    BaseEntity* Get( type_id id );
    BaseEntity* Get( const std::string &name );

private:
    /** Prune for entities that need to be removed */
    void Prune(type_EntList &list);

    type_EntList     m_entities;         // list of entities
public:
    virtual ~EntityManager(void);
};
